From 44aac8c402abd3c0f5eabf0d288e6c836a39c9dd Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Tue, 29 Apr 2014 11:41:03 -0700 Subject: [PATCH] Add Show for PackagePath --- src/cargo/core/source.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cargo/core/source.rs b/src/cargo/core/source.rs index e5c4fe267..e50e08041 100644 --- a/src/cargo/core/source.rs +++ b/src/cargo/core/source.rs @@ -1,11 +1,19 @@ +use std::fmt; use core::package::NameVer; use CargoResult; +#[deriving(Clone,Eq)] pub struct PackagePath { name: NameVer, path: Path } +impl fmt::Show for PackagePath { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f.buf, "{} at {}", self.name, self.path.display()) + } +} + impl PackagePath { pub fn new(name: NameVer, path: Path) -> PackagePath { PackagePath { name: name, path: path } -- 2.30.2